/**
 * 
 */
package vista;

import java.awt.Toolkit;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JFrame;

/**
 * @author De La
 *
 */
@SuppressWarnings("serial")
public class VentanaPrincipal extends JFrame{
	
	private MenuPrincipal menuPrincipal = new MenuPrincipal();
	
	
	public VentanaPrincipal() {
		super("Program & Conquer III");
		setBounds(200, 100, 260, 350);
		menuPrincipal.setBounds(0,0,260,350);
		menuPrincipal.setLayout(null);
		add(menuPrincipal);
		
		setVisible(true);
		setResizable(false);
		this.setLocation((int)Math.round(Toolkit.getDefaultToolkit().getScreenSize().getWidth()/2) - this.getWidth()/2, (int)Math.round(Toolkit.getDefaultToolkit().getScreenSize().getHeight()/2) - this.getHeight()/2);;
		addWindowListener(new CloseListener());
	}
	
	public static class CloseListener extends WindowAdapter {
		public void windowClosing(WindowEvent e)
		{	
			e.getWindow().setVisible(false);
			System.exit(0);
		}
	}
	
}
